package othello.core;

import java.util.List;

public abstract class AbstractOthelloPlayer implements OthelloPlayer{
    //このプレイヤーの石の色
    protected int myColor;
    //このプレイヤーの名前
    protected String name;

    public void setColor(int myColor){
        this.myColor = myColor;
    }

    public String getName(){
        return this.name;
    }

    //座標(x,y)に自分の石を置けるか返す
    protected boolean canPutStone(Board board, int x, int y){
        return OthelloUtil.canPutStone(board, myColor, x, y);
    }

    //自分の置ける全ての位置を返す
    protected List<CellPoint> getCanPutList(Board board){
        return OthelloUtil.getCanPutList(board, myColor);
    }

    //座標(x,y)が自分の石かどうかを返す
    protected boolean isMyStoneCell(Board board, int x, int y){
        return board.getCell(x, y) == myColor;
    }

    //座標(x,y)が相手の石かどうかを返す
    protected boolean isOpponentsStoneCell(Board board, int x, int y){
        return board.getCell(x, y) == -myColor;
    }

    //次の一手を決める
    public abstract NextHandInfo nextHand(Board board);
}